package com.hulk.producer;

/**
 * 功能概要：消息产生,提交到队列中去 
 * @author CUIJIAJUN
 * @date   2017年1月6日
 * 
 */
import javax.annotation.Resource;  

import org.slf4j.Logger;  
import org.slf4j.LoggerFactory;  
import org.springframework.amqp.core.AmqpTemplate;  
import org.springframework.stereotype.Service;  

@Service  
public class MessageProducer {  
      
    private Logger logger = LoggerFactory.getLogger(MessageProducer.class);  
  
    @Resource  
    private AmqpTemplate amqpTemplate;  
  
    public void sendMessage(Object message){  
      System.out.println("to send message:{}"+message);  
      amqpTemplate.convertAndSend("queueTestKey",message);  
    }  
}  